package chapter_10;

import java.io.IOException;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class TCPServer {
	public static void main(String[] args) throws IOException {
		ServerSocket ss = new ServerSocket(8888);
		Socket s = ss.accept();//阻塞在这里
		OutputStream out = s.getOutputStream();
		out.write("你已经连接上了服务器".getBytes());
		out.close();
		s.close();
	}
}
